<?php
	$username=$_GET["username"];
	$status=$_GET["status"];
	if ($username && $status){
		try{
			$conn=mysql_connect("127.0.0.1","root","");
			if ($conn){
				try{
					mysql_select_db("dbOpenFire", $conn);
					mysql_query("UPDATE dbOpenFire.ofVCard SET vcard=CONCAT(SUBSTRING_INDEX(vcard, '<RANDOMCHATSTATUS>', 1),'<RANDOMCHATSTATUS>".$status."</RANDOMCHATSTATUS>',SUBSTRING_INDEX(vcard, '</RANDOMCHATSTATUS>', -1)) WHERE username='".$username."'");
				}
				catch (Exception $e){
					echo "ERROR:".$e;
				}
			}
			else
				echo "ERROR:CONNERR"
		}
		catch{
			echo "ERROR:CONNERR";
		}
	}
	else
		echo "ERROR:NPARAMFND";
?>